home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / t2win-32 / _enumpj.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-08-24  |  6.4 KB  |  183 lines

  1. VERSION 4.00
  2. Begin VB.Form frmEnumPJ 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "EnumPrinterJobs"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4110
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7260
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7485
  37.       _Version        =   65536
  38.       _ExtentX        =   13203
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   4785
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7140
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6300
  71.          TabIndex        =   5
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   4
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6615
  96.          TabIndex        =   3
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. Attribute VB_Name = "frmEnumPJ"
  110. Attribute VB_Creatable = False
  111. Attribute VB_Exposed = False
  112. Option Explicit
  113. Option Base 1
  114. Private Const Iteration = 25
  115. Dim IsLoaded         As Integer
  116. Dim TimerStartOk     As Integer
  117. Dim TimerCloseOk     As Integer
  118. Dim TimerHandle      As Integer
  119. Dim TimerValue       As Long
  120. Private Sub cmb_Function_Click()
  121.    If (IsLoaded = False) Then Exit Sub
  122.    Call cDisableFI(mdiT2W.Picture1)
  123.    txt_Result = ""
  124.    DoEvents
  125.    Select Case cmb_Function.ListIndex
  126.       Case 0
  127.          Call TestEnumPJ
  128.    End Select
  129.    DoEvents
  130.    Call cEnableFI(mdiT2W.Picture1)
  131. End Sub
  132. Private Sub cmdNP_Click(Index As Integer)
  133.    Call sub_NextPrev(cmb_Function, Index)
  134. End Sub
  135. Private Sub Form_Activate()
  136.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  137. End Sub
  138. Private Sub Form_Load()
  139.    IsLoaded = False
  140.    Show
  141.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_enumpj.t2w")
  142.    IsLoaded = True
  143. End Sub
  144. Private Sub SSCommand1_Click()
  145.    Call cmb_Function_Click
  146. End Sub
  147. Public Sub TestEnumPJ()
  148.    Dim intResult        As Integer
  149.    Dim strDisplay       As String
  150.    Dim i                As Integer
  151.    strDisplay = ""
  152.    Dim JI               As tagJOBINFO
  153.    intResult = cEnumPrinterJobs("LPT1:", JI, True)
  154.    Do While intResult = EPJ_SUCCESS
  155.       strDisplay = strDisplay + "sPrinterName : '" & JI.sPrinterName & "'" & vbCrLf
  156.       strDisplay = strDisplay + "sMachineName : '" & JI.sMachineName & "'" & vbCrLf
  157.       strDisplay = strDisplay + "sUserName : '" & JI.sUserName & "'" & vbCrLf
  158.       strDisplay = strDisplay + "sDocument : '" & JI.sDocument & "'" & vbCrLf
  159.       strDisplay = strDisplay + "lJobId : " & JI.lJobId & vbCrLf
  160.       strDisplay = strDisplay + "lStatus : " & JI.lStatus & vbCrLf
  161.       strDisplay = strDisplay + "lPriority : " & JI.lPriority & vbCrLf
  162.       strDisplay = strDisplay + "lPosition : " & JI.lPosition & vbCrLf
  163.       strDisplay = strDisplay + "lStartTime : " & JI.lStartTime & vbCrLf
  164.       strDisplay = strDisplay + "lUntilTime : " & JI.lUntilTime & vbCrLf
  165.       strDisplay = strDisplay + "lTotalPages : " & JI.lTotalPages & vbCrLf
  166.       strDisplay = strDisplay + "lPagesPrinted : " & JI.lPagesPrinted & vbCrLf
  167.       strDisplay = strDisplay + "lSize : " & JI.lSize & vbCrLf
  168.       strDisplay = strDisplay + "lTime : " & JI.lTime & vbCrLf
  169.       strDisplay = strDisplay + "Submitted : " & JI.wMonth & "/" & JI.wDay & "/" & JI.wYear & " " & JI.wHour & ":" & JI.wMinute & ":" & JI.wSecond & vbCrLf & vbCrLf
  170.       
  171.       intResult = cEnumPrinterJobs("LPT1:", JI, False)
  172.    Loop
  173.    txt_Result = strDisplay
  174.    'time the function
  175.    TimerHandle = cTimerOpen()
  176.    TimerStartOk = cTimerStart(TimerHandle)
  177.    For i = 1 To Iteration
  178.       intResult = cEnumPrinterJobs("LPT1:", JI, True)
  179.    Next i
  180.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  181.    TimerCloseOk = cTimerClose(TimerHandle)
  182. End Sub
  183.